<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="/hui-ui/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="/hui-ui/static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="/hui-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="/hui-ui/static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="/hui-ui/static/h-ui.admin/css/style.css" />
</head>
<body>
<article class="cl pd-20">
	<form action="" class="form form-horizontal" id="form-local-pwd">
		<input type="hidden" id="id" name="id"/>
		<div class="row cl">
			<label class="form-label col-xs-5 col-sm-4"><span class="c-red">*</span>姓名：</label>
			<div class="formControls col-xs-5 col-sm-4">
				<input type="text" class="input-text" autocomplete="off" value="" placeholder="请输入姓名" id="userName" readonly="readonly" required="required">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-5 col-sm-4"><span class="c-red">*</span>原始密码：</label>
			<div class="formControls col-xs-5 col-sm-4">
				<input type="password" class="input-text" autocomplete="off" value="" placeholder="请输入原始密码" id="oldPassword" required="required">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-5 col-sm-4"><span class="c-red">*</span>新密码：</label>
			<div class="formControls col-xs-5 col-sm-4">
				<input type="password" class="input-text" autocomplete="off" value="" placeholder="请输入新密码" id="newPassword" required="required">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-4">
				<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;确认修改&nbsp;&nbsp;" onclick="doSave();">
			</div>
		</div>
	</form>
</article>

<script type="text/javascript" src="/hui-ui/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/hui-ui/lib/layer/2.4/layer.js"></script> 
<script type="text/javascript" src="/hui-ui/static/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="/hui-ui/static/h-ui.admin/js/H-ui.admin.page.js"></script> 
<script type="text/javascript" src="/hui-ui/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/hui-ui/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript">
	function doSave(){	
		if(!$('#oldPassword').val() || !$('#newPassword').val()){
			return;
		}
		$.ajax({  
			url: '/admin/user/modifyPwd',
	        type: 'post',  
	        dataType: 'json', 
	        data:{'id':$('#id').val(),'oldPassword':$('#oldPassword').val(),'newPassword':$('#newPassword').val()}
	        success: function (result) { 
	        	if(result.success){
	        		parent.layer.msg(result.message, {icon:6,time:2000});
		        	var index = parent.layer.getFrameIndex(window.name);
					parent.layer.close(index);
	        	}else{
	        		parent.layer.msg(result.message, {icon:5,time:2000});
	        	}
	        },
	        error:function(){
	        	var index = parent.layer.getFrameIndex(window.name);
	        	parent.layer.msg("修改失败", {icon:5,time:2000});
	        	parent.layer.close(index);
	        }
	    });  
	}
</script>
</body>
</html>